5 Star 1 Fork 0

HarmonyOS-TPC / CookieBar

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
Apache-2.0

Cookie Build Status

CookieBar是一个轻量级的库,用于在屏幕顶部或底部显示简短的消息。

快照

image

集成

方案一

添加har包到lib文件夹内
在entry的gradle内添加如下代码
implementation fileTree(dir: 'libs', include: ['*.jar', '*.har'])

方案二

implementation project(':library')

方案三

implementation 'io.openharmony.tpc.thirdlib:CookieBar:1.0.2'

简单使用CookieBar.

 new CookieBar.Builder(MainActivity.this)
                        .setTitle("TITLE")
                        .setMessage("MESSAGE")
                        .show();

带图标和按钮的CookieBar使用

 new CookieBar.Builder(MainActivity.this)
                        .setTitle("TITLE")
                        .setIcon(R.mipmap.ic_launcher)
                        .setMessage("MESSAGE")
                        .setAction("ACTION", new OnActionClickListener() {
                            @Override
                            public void onClick() {
                            }
                        })
                        .show();

您可以通过设置主题的属性来更改默认样式

{
  "color":[
    {
      "name":"default_bg_color",
      "value":"#BDBDBD"
    },
    {
      "name":"default_title_color",
      "value":"#ffffff"
    },
    {
      "name":"default_message_color",
      "value":"#ffffff"
    },
    {
      "name":"white",
      "value":"#ffffff"
    },
    {
      "name":"default_action_color",
      "value":"#26a69a"
    }
  ]
}

或者使用cookie生成器动态更改样式。

  • layoutGravity
  • backgroundColor
  • titleColor
  • messageColor
  • actionColor
  • duration

New Features

1.0.0

  • 操作按钮可以替换为图标。

License

Copyright 2017 Eric Liu

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Cookie [![Build Status](https://travis-ci.org/liuguangqiang/SwipeBack.png?branch=master)](https://travis-ci.org/liuguangqiang/CookieBar) ============================================== CookieBar是一个轻量级的库,用于在屏幕顶部或底部显示简短的消息。 ## 快照 ![image](gif/cookiebar.gif) ## 集成 ### 方案一 ``` 添加har包到lib文件夹内 在entry的gradle内添加如下代码 implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) ``` ### 方案二 ``` implementation project(':library') ``` ### 方案三 ``` implementation 'io.openharmony.tpc.thirdlib:CookieBar:1.0.2' ``` ## 简单使用CookieBar. ``` new CookieBar.Builder(MainActivity.this) .setTitle("TITLE") .setMessage("MESSAGE") .show(); ``` ## 带图标和按钮的CookieBar使用 ``` new CookieBar.Builder(MainActivity.this) .setTitle("TITLE") .setIcon(R.mipmap.ic_launcher) .setMessage("MESSAGE") .setAction("ACTION", new OnActionClickListener() { @Override public void onClick() { } }) .show(); ``` ## 您可以通过设置主题的属性来更改默认样式 ``` { "color":[ { "name":"default_bg_color", "value":"#BDBDBD" }, { "name":"default_title_color", "value":"#ffffff" }, { "name":"default_message_color", "value":"#ffffff" }, { "name":"white", "value":"#ffffff" }, { "name":"default_action_color", "value":"#26a69a" } ] } ``` ## 或者使用cookie生成器动态更改样式。 * layoutGravity * backgroundColor * titleColor * messageColor * actionColor * duration ## New Features #### 1.0.0 * 操作按钮可以替换为图标。 ## License Copyright 2017 Eric Liu Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

简介

CookieBar是一个轻量级的库,用于在屏幕顶部或底部显示简短的消息 展开 收起
Java
Apache-2.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/HarmonyOS-tpc/CookieBar.git
git@gitee.com:HarmonyOS-tpc/CookieBar.git
HarmonyOS-tpc
CookieBar
CookieBar
master

搜索帮助